package com.ruoyi.supervise.util;

import java.util.ArrayList;
import java.util.List;

import javax.xml.xpath.XPathConstants;

import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.supervise.domain.Affix;
import com.ruoyi.supervise.domain.CertChangeInfo;
import com.ruoyi.supervise.domain.CertRecheckInfo;
import com.ruoyi.supervise.domain.CheckConclu;
import com.ruoyi.supervise.domain.ChildTokens;
import com.ruoyi.supervise.domain.ConDrawFirstTrial;
import com.ruoyi.supervise.domain.ConDrawMajor;
import com.ruoyi.supervise.domain.ConstructionPermitChangeApplyFile;
import com.ruoyi.supervise.domain.ConsturctionCertChangeInfo;
import com.ruoyi.supervise.domain.CreditPerformanceContent;
import com.ruoyi.supervise.domain.Emphasize;
import com.ruoyi.supervise.domain.ModifyRecs;
import com.ruoyi.supervise.domain.OpinionCauseContent;
import com.ruoyi.supervise.domain.OpinionConent;
import com.ruoyi.supervise.domain.RelatedDesignUnits;
import com.ruoyi.supervise.domain.ReviewExperts;
import com.ruoyi.supervise.domain.WDCertificateTextUnit;

import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.XmlUtil;

public class XmlReadUtil {

	/**
	 * @Title: getRelatedDesignUnitsXml
	 * @Description: 图审设计单位信息
	 * @Author wtj
	 * @DateTime 2020年3月20日 下午3:53:47
	 * @param strXml
	 * @param nodePath
	 * @param rdu
	 * @return
	 */
	public static List<RelatedDesignUnits> getRelatedDesignUnitsXml(String strXml, String nodePath, RelatedDesignUnits rdu){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<RelatedDesignUnits> rduList = new ArrayList<RelatedDesignUnits>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			RelatedDesignUnits rduNew=new RelatedDesignUnits();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getGuid(), docResult, XPathConstants.STRING);
			rduNew.setGuid(String.valueOf(guid));
			Object name =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getName(), docResult, XPathConstants.STRING);
			rduNew.setName(String.valueOf(name));
			Object linkMan =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getLinkMan(), docResult, XPathConstants.STRING);
			rduNew.setLinkMan(String.valueOf(linkMan));
			Object linkTel =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getLinkTel(), docResult, XPathConstants.STRING);
			rduNew.setLinkTel(String.valueOf(linkTel));
			Object linkEMail =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getLinkEMail(), docResult, XPathConstants.STRING);
			rduNew.setLinkEMail(String.valueOf(linkEMail));
			Object designContractAmount =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getDesignContractAmount(), docResult, XPathConstants.STRING);
			rduNew.setDesignContractAmount(String.valueOf(designContractAmount));
			Object leadMan =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getLeadMan(), docResult, XPathConstants.STRING);
			rduNew.setLeadMan(String.valueOf(leadMan));
			Object certLevel =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getCertLevel(), docResult, XPathConstants.STRING);
			rduNew.setCertLevel(String.valueOf(certLevel));
			Object certNum =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getCertNum(), docResult, XPathConstants.STRING);
			rduNew.setCertNum(String.valueOf(certNum));
			Object performs =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getPerforms(), docResult, XPathConstants.STRING);
			rduNew.setPerforms(String.valueOf(performs));
			Object performsIDCard =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getPerformsIDCard(), docResult, XPathConstants.STRING);
			rduNew.setPerformsIDCard(String.valueOf(performsIDCard));
			Object projectDir =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getProjectDir(), docResult, XPathConstants.STRING);
			rduNew.setProjectDir(String.valueOf(projectDir));
			Object projectDirIDCard =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getProjectDirIDCard(), docResult, XPathConstants.STRING);
			rduNew.setProjectDirIDCard(String.valueOf(projectDirIDCard));
			Object dean =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getDean(), docResult, XPathConstants.STRING);
			rduNew.setDean(String.valueOf(dean));
			Object deanIDCard =XmlUtil.getByXPath(nodePath +"["+i+"]/" + rdu.getDeanIDCard(), docResult, XPathConstants.STRING);
			rduNew.setDeanIDCard(String.valueOf(deanIDCard));
			rduList.add(rduNew);
		}
		return rduList;
	}
	
	/**
	 * @Title: getCertificateTextXml
	 * @Description: 获取合格证信息
	 * @Author wtj
	 * @DateTime 2020年3月27日 下午3:03:38
	 * @param strXml
	 * @param nodePath
	 * @param ct
	 * @return
	 */
	public static List<WDCertificateTextUnit> getCertificateTextXml(String strXml, String nodePath, WDCertificateTextUnit ctu){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<WDCertificateTextUnit> ctuList = new ArrayList<WDCertificateTextUnit>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			WDCertificateTextUnit ctuNew=new WDCertificateTextUnit();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ctu.getGuid(), docResult, XPathConstants.STRING);
			ctuNew.setGuid(String.valueOf(guid));
			Object name =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ctu.getName(), docResult, XPathConstants.STRING);
			ctuNew.setName(String.valueOf(name));
			Object layer =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ctu.getLayer(), docResult, XPathConstants.STRING);
			ctuNew.setLayer(String.valueOf(layer));
			Object upArea =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ctu.getUpArea(), docResult, XPathConstants.STRING);
			ctuNew.setUpArea(String.valueOf(upArea));
			Object downArea =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ctu.getDownArea(), docResult, XPathConstants.STRING);
			ctuNew.setDownArea(String.valueOf(downArea));
			Object applicationArea =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ctu.getApplicationArea(), docResult, XPathConstants.STRING);
			ctuNew.setApplicationArea(String.valueOf(applicationArea));
			Object collectHotArea =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ctu.getCollectHotArea(), docResult, XPathConstants.STRING);
			ctuNew.setCollectHotArea(String.valueOf(collectHotArea));
			ctuList.add(ctuNew);
		}
		return ctuList;
	}
	
	public static List<ConstructionPermitChangeApplyFile> getConstructionPermitChangeApplyFile(String strXml, String nodePath, ConstructionPermitChangeApplyFile cpcaf){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<ConstructionPermitChangeApplyFile> cpcafList = new ArrayList<ConstructionPermitChangeApplyFile>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			ConstructionPermitChangeApplyFile cpcafNew = new ConstructionPermitChangeApplyFile();
			Object chekFileName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpcaf.getChekFileName(), docResult, XPathConstants.STRING);
			cpcafNew.setChekFileName(String.valueOf(chekFileName));
			Object reMark =XmlUtil.getByXPath(nodePath +"["+i+"]/CheckFile/" + cpcaf.getReMark(), docResult, XPathConstants.STRING);
			cpcafNew.setReMark(String.valueOf(reMark));
			Object acceName =XmlUtil.getByXPath(nodePath +"["+i+"]/CheckFile/" + cpcaf.getAcceName(), docResult, XPathConstants.STRING);
			cpcafNew.setAcceName(String.valueOf(acceName));
			Object operator =XmlUtil.getByXPath(nodePath +"["+i+"]/CheckFile/" + cpcaf.getOperator(), docResult, XPathConstants.STRING);
			cpcafNew.setOperator(String.valueOf(operator));
			Object createDate =XmlUtil.getByXPath(nodePath +"["+i+"]/CheckFile/" + cpcaf.getCreateDate(), docResult, XPathConstants.STRING);
			cpcafNew.setCreateDate(String.valueOf(createDate));
			cpcafList.add(cpcafNew);
		}
		return cpcafList;
	}
	
	public static List<ConsturctionCertChangeInfo> getConsturctionCertChangeInfoXml(String strXml, String nodePath, ConsturctionCertChangeInfo ccci){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<ConsturctionCertChangeInfo> ccciList = new ArrayList<ConsturctionCertChangeInfo>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			ConsturctionCertChangeInfo ccciNew=new ConsturctionCertChangeInfo();
			Object modifiedPersonLoginName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ccci.getModifiedPersonLoginName(), docResult, XPathConstants.STRING);
			ccciNew.setModifiedPersonLoginName(String.valueOf(modifiedPersonLoginName));
			Object modifiedPersonRealName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ccci.getModifiedPersonRealName(), docResult, XPathConstants.STRING);
			ccciNew.setModifiedPersonRealName(String.valueOf(modifiedPersonRealName));
			Object unitName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ccci.getUnitName(), docResult, XPathConstants.STRING);
			ccciNew.setUnitName(String.valueOf(unitName));
			Object pubDate =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ccci.getPubDate(), docResult, XPathConstants.STRING);
			ccciNew.setPubDate(String.valueOf(pubDate));
			Object content =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ccci.getContent(), docResult, XPathConstants.STRING);
			ccciNew.setContent(String.valueOf(content));
			ccciList.add(ccciNew);
		}
		return ccciList;
	}
	
	public static List<ModifyRecs> getModifyRecsXml(String strXml, String nodePath, ModifyRecs mr){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<ModifyRecs> mrList = new ArrayList<ModifyRecs>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			ModifyRecs mrNew=new ModifyRecs();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + mr.getGuid(), docResult, XPathConstants.STRING);
			mrNew.setGuid(String.valueOf(guid));
			Object type =XmlUtil.getByXPath(nodePath +"["+i+"]/" + mr.getType(), docResult, XPathConstants.STRING);
			mrNew.setType(String.valueOf(type));
			Object createDate =XmlUtil.getByXPath(nodePath +"["+i+"]/" + mr.getCreateDate(), docResult, XPathConstants.STRING);
			mrNew.setCreateDate(String.valueOf(createDate));
			Object content =XmlUtil.getByXPath(nodePath +"["+i+"]/" + mr.getContent(), docResult, XPathConstants.STRING);
			mrNew.setContent(String.valueOf(content));
			Object personCertificateBillGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + mr.getPersonCertificateBillGuid(), docResult, XPathConstants.STRING);
			mrNew.setPersonCertificateBillGuid(String.valueOf(personCertificateBillGuid));
			mrList.add(mrNew);
		}
		return mrList;
	}
	
	public static List<CreditPerformanceContent> getCreditPerformanceContentXml(String strXml, String nodePath, CreditPerformanceContent cpc){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<CreditPerformanceContent> cpcList = new ArrayList<CreditPerformanceContent>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			CreditPerformanceContent cpcNew=new CreditPerformanceContent();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpc.getGuid(), docResult, XPathConstants.STRING);
			cpcNew.setGuid(String.valueOf(guid));
			Object checkContent =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpc.getCheckContent(), docResult, XPathConstants.STRING);
			cpcNew.setCheckContent(String.valueOf(checkContent));
			Object checkTime =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpc.getCheckTime(), docResult, XPathConstants.STRING);
			cpcNew.setCheckTime(String.valueOf(checkTime));
			Object workDone =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpc.getWorkDone(), docResult, XPathConstants.STRING);
			cpcNew.setWorkDone(String.valueOf(workDone));
			Object principal =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpc.getPrincipal(), docResult, XPathConstants.STRING);
			cpcNew.setPrincipal(String.valueOf(principal));
			Object principalPhone =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpc.getPrincipalPhone(), docResult, XPathConstants.STRING);
			cpcNew.setPrincipalPhone(String.valueOf(principalPhone));
			Object checkTimeEndDate =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpc.getCheckTimeEndDate(), docResult, XPathConstants.STRING);
			cpcNew.setCheckTimeEndDate(String.valueOf(checkTimeEndDate));
			Object checkProjectType =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cpc.getCheckProjectType(), docResult, XPathConstants.STRING);
			cpcNew.setCheckProjectType(String.valueOf(checkProjectType));
			cpcList.add(cpcNew);
		}
		return cpcList;
	}
	
	public static List<CertChangeInfo> getCertChangeInfoXml(String strXml, String nodePath, CertChangeInfo cci){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<CertChangeInfo> cciList = new ArrayList<CertChangeInfo>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			CertChangeInfo cciNew=new CertChangeInfo();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cci.getGuid(), docResult, XPathConstants.STRING);
			cciNew.setGuid(String.valueOf(guid));
			Object type =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cci.getType(), docResult, XPathConstants.STRING);
			cciNew.setType(String.valueOf(type));
			Object createDate =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cci.getCreateDate(), docResult, XPathConstants.STRING);
			cciNew.setCreateDate(String.valueOf(createDate));
			Object content =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cci.getContent(), docResult, XPathConstants.STRING);
			cciNew.setContent(String.valueOf(content));
			Object personCertificateBillGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cci.getPersonCertificateBillGuid(), docResult, XPathConstants.STRING);
			cciNew.setPersonCertificateBillGuid(String.valueOf(personCertificateBillGuid));
			cciList.add(cciNew);
		}
		return cciList;
	}
	
	public static List<CertRecheckInfo> getCertRecheckInfoXml(String strXml, String nodePath, CertRecheckInfo cri){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<CertRecheckInfo> criList = new ArrayList<CertRecheckInfo>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			CertRecheckInfo criNew=new CertRecheckInfo();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cri.getGuid(), docResult, XPathConstants.STRING);
			criNew.setGuid(String.valueOf(guid));
			Object recheckDate =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cri.getRecheckDate(), docResult, XPathConstants.STRING);
			criNew.setRecheckDate(String.valueOf(recheckDate));
			Object hours =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cri.getHours(), docResult, XPathConstants.STRING);
			criNew.setHours(String.valueOf(hours));
			criList.add(criNew);
		}
		return criList;
	}
	
	public static List<OpinionCauseContent> getOpinionCauseContentXml(String strXml, String nodePath, OpinionCauseContent occ){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<OpinionCauseContent> occList = new ArrayList<OpinionCauseContent>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			OpinionCauseContent occNew=new OpinionCauseContent();
			Object no =XmlUtil.getByXPath(nodePath +"["+i+"]/" + occ.getNo(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(no))) {
				occNew.setNo(String.valueOf(no));
			}
			Object name =XmlUtil.getByXPath(nodePath +"["+i+"]/" + occ.getName(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(name))) {
				occNew.setName(String.valueOf(name));
			}
			Object value =XmlUtil.getByXPath(nodePath +"["+i+"]/" + occ.getValue(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(value))) {
				occNew.setValue(String.valueOf(value));
			}
			if(StringUtils.allFieldIsNotNull(occNew)) {
				occList.add(occNew);
			}
		}
		return occList;
	}
	
	public static List<ReviewExperts> getReviewExpertsXml(String strXml, String nodePath, ReviewExperts re){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<ReviewExperts> reList = new ArrayList<ReviewExperts>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			ReviewExperts reNew=new ReviewExperts();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(guid))) {
				reNew.setGuid(String.valueOf(guid));
			}
			Object name =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getName(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(name))) {
				reNew.setName(String.valueOf(name));
			}
			Object sex =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getSex(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(sex))) {
				reNew.setSex(String.valueOf(sex));
			}
			Object phone =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getPhone(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(phone))) {
				reNew.setPhone(String.valueOf(phone));
			}
			Object titles =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getTitles(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(titles))) {
				reNew.setTitles(String.valueOf(titles));
			}
			Object professional =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getProfessional(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(professional))) {
				reNew.setProfessional(String.valueOf(professional));
			}
			Object loginID =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getLoginID(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(loginID))) {
				reNew.setLoginID(String.valueOf(loginID));
			}
			Object workCompany =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getWorkCompany(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(workCompany))) {
				reNew.setWorkCompany(String.valueOf(workCompany));
			}
			Object taskGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getTaskGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(taskGuid))) {
				reNew.setTaskGuid(String.valueOf(taskGuid));
			}
			Object newExpertGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getNewExpertGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(newExpertGuid))) {
				reNew.setNewExpertGuid(String.valueOf(newExpertGuid));
			}
			Object newExpertName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + re.getNewExpertName(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(newExpertName))) {
				reNew.setNewExpertName(String.valueOf(newExpertName));
			}
			if(StringUtils.allFieldIsNotNull(reNew)) {
				reList.add(reNew);
			}
		}
		return reList;
	}
	
	/**
	 * @Title: getEmphasizeXml
	 * @Description: 把符合Emphasize实体的xml转为Emphasize实体
	 * @Author wtj
	 * @DateTime 2020-9-3 10:09:06
	 * @param strXml传入的xml
	 * @param nodePath节点路径
	 * @param nodePathTwo子节点的名称
	 * @param e主实体
	 * @param oc子节点实体
	 * @return
	 */
	public static List<Emphasize> getEmphasizeXml(String strXml, String nodePath, String nodePathTwo, Emphasize e, OpinionConent oc){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<Emphasize> eList = new ArrayList<Emphasize>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			Emphasize eNew=new Emphasize();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + e.getGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(guid))) {
				eNew.setGuid(String.valueOf(guid));
			}
			Object standardNo =XmlUtil.getByXPath(nodePath +"["+i+"]/" + e.getStandardNo(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(standardNo))) {
				eNew.setStandardNo(String.valueOf(standardNo));
			}
			Object itemNo =XmlUtil.getByXPath(nodePath +"["+i+"]/" + e.getItemNo(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(itemNo))) {
				eNew.setItemNo(String.valueOf(itemNo));
			}
			Object professional =XmlUtil.getByXPath(nodePath +"["+i+"]/" + e.getProfessional(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(professional))) {
				eNew.setProfessional(String.valueOf(professional));
			}
			Object unitEngineeringInfoGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + e.getUnitEngineeringInfoGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(unitEngineeringInfoGuid))) {
				eNew.setUnitEngineeringInfoGuid(String.valueOf(unitEngineeringInfoGuid));
			}
			Object enabled =XmlUtil.getByXPath(nodePath +"["+i+"]/" + e.getEnabled(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(enabled))) {
				eNew.setEnabled(String.valueOf(enabled));
			}
			List<OpinionConent> ocList = new ArrayList<OpinionConent>();
			NodeList nodeNewList = XmlUtil.getNodeListByXPath(nodePath +"["+i+"]/" + nodePathTwo, docResult);
			for(int a = 1; a < nodeNewList.getLength()+1; a++) {
				OpinionConent ocNew = new OpinionConent();
				Object ocGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getGuid(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(ocGuid))) {
					ocNew.setGuid(String.valueOf(ocGuid));
				}
				Object description =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getDescription(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(description))) {
					ocNew.setDescription(String.valueOf(description));
					if(StrUtil.containsIgnoreCase(String.valueOf(description), "(整改)")) {
						ocNew.setNote("整改");
					}
				}
				Object replyConclusion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getReplyConclusion(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(replyConclusion))) {
					ocNew.setReplyConclusion(String.valueOf(replyConclusion));
				}
				Object replyOpinion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getReplyOpinion(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(replyOpinion))) {
					ocNew.setReplyOpinion(String.valueOf(replyOpinion));
				}
				Object expertConclusion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getExpertConclusion(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(expertConclusion))) {
					ocNew.setExpertConclusion(String.valueOf(expertConclusion));
				}
				Object expertOpinion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getExpertOpinion(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(expertOpinion))) {
					ocNew.setExpertOpinion(String.valueOf(expertOpinion));
				}
				Object expertName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getExpertName(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(expertName))) {
					ocNew.setExpertName(String.valueOf(expertName));
				}
				Object expertGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getExpertGuid(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(expertGuid))) {
					ocNew.setExpertGuid(String.valueOf(expertGuid));
				}
				Object replyExpertGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getReplyExpertGuid(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(replyExpertGuid))) {
					ocNew.setReplyExpertGuid(String.valueOf(replyExpertGuid));
				}
				Object replyExpertName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + nodePathTwo + "["+a+"]/" + oc.getReplyExpertName(), docResult, XPathConstants.STRING);
				if(!StringUtils.isEmpty(String.valueOf(replyExpertName))) {
					ocNew.setReplyExpertName(String.valueOf(replyExpertName));
				}
				if(StringUtils.allFieldIsNotNull(ocNew)) {
					ocList.add(ocNew);
				}
			}
			if(StringUtils.isNotEmpty(ocList)) {
				eNew.setOpinionConent(ocList);
			}
			if(StringUtils.allFieldIsNotNull(eNew)) {
				eList.add(eNew);
			}
		}
		return eList;
	}
	
	public static List<OpinionConent> getOpinionConentXml(String strXml, String nodePath, OpinionConent oc){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<OpinionConent> ocList = new ArrayList<OpinionConent>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			OpinionConent ocNew=new OpinionConent();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(guid))) {
				ocNew.setGuid(String.valueOf(guid));
			}
			Object description =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getDescription(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(description))) {
				ocNew.setDescription(String.valueOf(description));
			}
			Object replyConclusion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getReplyConclusion(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(replyConclusion))) {
				ocNew.setReplyConclusion(String.valueOf(replyConclusion));
			}
			Object replyOpinion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getReplyOpinion(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(replyOpinion))) {
				ocNew.setReplyOpinion(String.valueOf(replyOpinion));
			}
			Object expertConclusion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getExpertConclusion(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(expertConclusion))) {
				ocNew.setExpertConclusion(String.valueOf(expertConclusion));
			}
			Object expertOpinion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getExpertOpinion(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(expertOpinion))) {
				ocNew.setExpertOpinion(String.valueOf(expertOpinion));
			}
			Object expertName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getExpertName(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(expertName))) {
				ocNew.setExpertName(String.valueOf(expertName));
			}
			Object expertGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getExpertGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(expertGuid))) {
				ocNew.setExpertGuid(String.valueOf(expertGuid));
			}
			Object replyExpertGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getReplyExpertGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(replyExpertGuid))) {
				ocNew.setReplyExpertGuid(String.valueOf(replyExpertGuid));
			}
			Object replyExpertName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getReplyExpertName(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(replyExpertName))) {
				ocNew.setReplyExpertName(String.valueOf(replyExpertName));
			}
			Object professional =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getProfessional(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(professional))) {
				ocNew.setProfessional(String.valueOf(professional));
			}
			Object unitEngineeringInfoGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + oc.getUnitEngineeringInfoGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(unitEngineeringInfoGuid))) {
				ocNew.setUnitEngineeringInfoGuid(String.valueOf(unitEngineeringInfoGuid));
			}
			if(StringUtils.allFieldIsNotNull(ocNew)) {
				ocList.add(ocNew);
			}
		}
		return ocList;
	}
	
	public static List<Affix> getAffixXml(String strXml, String nodePath, Affix a){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<Affix> aList = new ArrayList<Affix>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			Affix aNew=new Affix();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(guid))) {
				aNew.setGuid(String.valueOf(guid));
			}
			Object acceName =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getAcceName(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(acceName))) {
				aNew.setAcceName(String.valueOf(acceName));
			}
			Object acceId =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getAcceId(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(acceId))) {
				aNew.setAcceId(String.valueOf(acceId));
			}
			Object operator =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getOperator(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(operator))) {
				aNew.setOperator(String.valueOf(operator));
			}
			Object createDate =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getCreateDate(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(createDate))) {
				aNew.setCreateDate(String.valueOf(createDate));
			}
			Object categoryID =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getCategoryID(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(categoryID))) {
				aNew.setCategoryID(String.valueOf(categoryID));
			}
			Object ownerGuid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getOwnerGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(ownerGuid))) {
				aNew.setOwnerGuid(String.valueOf(ownerGuid));
			}
			Object sortID =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getSortID(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(sortID))) {
				aNew.setSortID(String.valueOf(sortID));
			}
			Object copy =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getCopy(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(copy))) {
				aNew.setCopy(String.valueOf(copy));
			}
			Object latestCopy =XmlUtil.getByXPath(nodePath +"["+i+"]/" + a.getLatestCopy(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(latestCopy))) {
				aNew.setLatestCopy(String.valueOf(latestCopy));
			}
			if(StringUtils.allFieldIsNotNull(aNew)) {
				aList.add(aNew);
			}
		}
		return aList;
	}
	
	public static String getAStringXml(String strXml, String nodePath){
		Document docResult=XmlUtil.readXML(strXml);
		Object conclusionobj =XmlUtil.getByXPath(nodePath, docResult, XPathConstants.STRING);
		return String.valueOf(conclusionobj);
	}
	
	public static List<CheckConclu> getCheckConcluXml(String strXml, String nodePath, CheckConclu cc){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<CheckConclu> ccList = new ArrayList<CheckConclu>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			CheckConclu ccNew=new CheckConclu();
			Object name =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cc.getName(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(name))) {
				ccNew.setName(String.valueOf(name));
			}
			Object conclusion =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cc.getConclusion(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(conclusion))) {
				ccNew.setConclusion(String.valueOf(conclusion));
			}
			if(StringUtils.allFieldIsNotNull(ccNew)) {
				ccList.add(ccNew);
			}
		}
		return ccList;
	}
	
	/**
	 * @Title: getTecPassReturnXml
	 * @Description: 该方法只适用于施工图审查日志中技术负责人审查退回这条数据的GroupOpinions字段解析，解析的内容跟大平台中，施工图审日志中技术负责人审查退回状态的技术负责人审核意见内容一致
	 * @Author X1 Yoga
	 * @DateTime 2020-10-28 15:20:24
	 * @param strXml字段的xml
	 * @param nodePath根据专业区分的第一级解析的路径
	 * @param emphasizeNodePath第二级解析中的违反强制性条文
	 * @param generalCommentNodePath第二级解析中的违反一般规范条文
	 * @param finalCommentNodePath第二级解析中的其它意见
	 * @param seismicCommentNodePath第二级解析中的抗震专项意见
	 * @param specialCommentNodePath第二级解析中的节能及太阳能专项审查意见
	 * @param greenCommentNodePath第二级解析中的绿色建筑审查意见
	 * @param affixNodePath第二级解析中的文件
	 * @param cdm用来帮助解析xml的实体
	 * @param cdftList经过封装的根据单位工程区分的集合
	 * @param oc用来帮助解析xml的实体
	 * @param e用来帮助解析xml的实体
	 * @param a用来帮助解析xml的实体
	 * @return 返回ConDrawMajor格式的List集合
	 */
	public static List<ConDrawMajor> getTecPassReturnXml(String strXml, String nodePath, String emphasizeNodePath, String generalCommentNodePath, String finalCommentNodePath, String seismicCommentNodePath, String specialCommentNodePath, String greenCommentNodePath, String affixNodePath, ConDrawMajor cdm, List<ConDrawFirstTrial> cdftList, OpinionConent oc, Emphasize e, Affix a){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<ConDrawMajor> cdmList = new ArrayList<ConDrawMajor>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			ConDrawMajor cdmNew=new ConDrawMajor();
			Object major =XmlUtil.getByXPath(nodePath +"["+i+"]/" + cdm.getMajor(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(major))) {
				cdmNew.setMajor(String.valueOf(major));
			}
			List<ConDrawFirstTrial> cdftNewList = new ArrayList<ConDrawFirstTrial>();
			//cdftNewList.addAll(cdftList);
			for(ConDrawFirstTrial cdftcopy:cdftList) {
				try {
					cdftNewList.add(cdftcopy.clone());
				} catch (CloneNotSupportedException e1) {
					e1.printStackTrace();
					System.out.println("克隆出错");
				}
			}
			//违反强制性条文
			List<Emphasize> emphasizeList = getEmphasizeXml(strXml, nodePath +"["+i+"]"+emphasizeNodePath,"OpinionConent", e, oc);
			//违反一般规范条文
			List<Emphasize> generalCommentList = getEmphasizeXml(strXml, nodePath +"["+i+"]"+generalCommentNodePath,"OpinionConent", e, oc);
			//其它意见
			List<OpinionConent> finalCommentList = getOpinionConentXml(strXml, nodePath +"["+i+"]"+finalCommentNodePath, oc);
			//抗震专项意见
			List<OpinionConent> seismicCommentList = getOpinionConentXml(strXml, nodePath +"["+i+"]"+seismicCommentNodePath, oc);
			//节能及太阳能专项审查意见
			List<OpinionConent> specialCommentList = getOpinionConentXml(strXml, nodePath +"["+i+"]"+specialCommentNodePath, oc);
			//绿色建筑审查意见
			List<OpinionConent> greenCommentList = getOpinionConentXml(strXml, nodePath +"["+i+"]"+greenCommentNodePath, oc);
			//答复附件
			List<Affix> affixList = getAffixXml(strXml, nodePath +"["+i+"]"+affixNodePath, a);
			
			//从节点/PsDataPacket/FDataList/WDGroupOpinion/ExpertOpinions/FDataList/WDOpinionInfo/FDataList/WDGroupOpinion  获取的数据
			String nodePathed = "/ExpertOpinions/FDataList/WDOpinionInfo/GroupOpinions/FDataList/WDGroupOpinion";
			//违反强制性条文
			List<Emphasize> emphasizeedList = getEmphasizeXml(strXml, nodePath +"["+i+"]"+nodePathed+"/Emphasize","OpinionConent", e, oc);
			//违反一般规范条文
			List<Emphasize> generalCommentedList = getEmphasizeXml(strXml, nodePath +"["+i+"]"+nodePathed+"/GeneralComment/FDataList/Emphasize","OpinionConent", e, oc);
			//其它意见
			List<OpinionConent> finalCommentedList = getOpinionConentXml(strXml, nodePath +"["+i+"]"+nodePathed+"/FinalComment/FDataList/OpinionItem", oc);
			//抗震专项意见
			List<OpinionConent> seismicCommentedList = getOpinionConentXml(strXml, nodePath +"["+i+"]"+nodePathed+"/SeismicComment/FDataList/OpinionItem", oc);
			//节能及太阳能专项审查意见
			List<OpinionConent> specialCommentedList = getOpinionConentXml(strXml, nodePath +"["+i+"]"+nodePathed+"/SpecialComment/FDataList/OpinionItem", oc);
			//绿色建筑审查意见
			List<OpinionConent> greenCommentedList = getOpinionConentXml(strXml, nodePath +"["+i+"]"+nodePathed+"/GreenComment/FDataList/OpinionItem", oc);
			//答复附件
			List<Affix> affixedList = getAffixXml(strXml, nodePath +"["+i+"]"+nodePathed+"/Affix", a);
			for(ConDrawFirstTrial cdft:cdftNewList) {
				List<Emphasize> emphasizeListNew = new ArrayList<Emphasize>();
			    List<Emphasize> generalCommentListNew = new ArrayList<Emphasize>();
			    List<OpinionConent> finalCommentListNew = new ArrayList<OpinionConent>();
			    List<OpinionConent> seismicCommentListNew = new ArrayList<OpinionConent>();
			    List<OpinionConent> specialCommentListNew = new ArrayList<OpinionConent>();
			    List<OpinionConent> greenCommentListNew = new ArrayList<OpinionConent>();
			    
			    List<Emphasize> emphasizeedListNew = new ArrayList<Emphasize>();
			    List<Emphasize> generalCommentedListNew = new ArrayList<Emphasize>();
			    List<OpinionConent> finalCommentedListNew = new ArrayList<OpinionConent>();
			    List<OpinionConent> seismicCommentedListNew = new ArrayList<OpinionConent>();
			    List<OpinionConent> specialCommentedListNew = new ArrayList<OpinionConent>();
			    List<OpinionConent> greenCommentedListNew = new ArrayList<OpinionConent>();
			    //答复附件
			    if(StringUtils.isNotEmpty(affixList)) {
			    	cdft.setAffix(affixList.get(0));
			    }
			    if(StringUtils.isNotEmpty(affixedList)) {
			    	cdft.setAffixed(affixedList.get(0));
			    }
			    //封装违反强制性条文
			    for(Emphasize emphasize:emphasizeList) {
			    	if(emphasize.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
			    		for(OpinionConent opinionConent:emphasize.getOpinionConent()) {
			    			if(StrUtil.containsIgnoreCase(opinionConent.getDescription(), "(整改)")) {
								   opinionConent.setNote("整改");
						    }
			    		}
			    		emphasizeListNew.add(emphasize);
			    	}
			    }
			    cdft.setEmphasizeList(emphasizeListNew);
			    for(Emphasize emphasize:emphasizeedList) {
			    	if(emphasize.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
			    		for(OpinionConent opinionConent:emphasize.getOpinionConent()) {
			    			if(StrUtil.containsIgnoreCase(opinionConent.getDescription(), "(整改)")) {
								   opinionConent.setNote("整改");
						    }
			    		}
			    		emphasizeedListNew.add(emphasize);
			    	}
			    }
			    cdft.setEmphasizeedList(emphasizeedListNew);
			    //封装违反一般规范条文
			    for(Emphasize generalComment:generalCommentList) {
					if(generalComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						for(OpinionConent opinionConent:generalComment.getOpinionConent()) {
							if(StrUtil.containsIgnoreCase(opinionConent.getDescription(), "(整改)")) {
								   opinionConent.setNote("整改");
						    }
						}
						generalCommentListNew.add(generalComment);
					}
				}
			    cdft.setGeneralCommentList(generalCommentListNew);
			    for(Emphasize generalComment:generalCommentedList) {
					if(generalComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						for(OpinionConent opinionConent:generalComment.getOpinionConent()) {
							if(StrUtil.containsIgnoreCase(opinionConent.getDescription(), "(整改)")) {
								   opinionConent.setNote("整改");
						    }
						}
						generalCommentedListNew.add(generalComment);
					}
				}
			    cdft.setGeneralCommentedList(generalCommentedListNew);
			    //封装审查人员审查其他意见
				for(OpinionConent finalComment:finalCommentList) {
					if(finalComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						finalCommentListNew.add(finalComment);
					}
				}
				cdft.setFinalCommentList(finalCommentListNew);
				for(OpinionConent finalComment:finalCommentedList) {
					if(finalComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						finalCommentedListNew.add(finalComment);
					}
				}
				cdft.setFinalCommentedList(finalCommentedListNew);
				//封装抗震专项意见
				for(OpinionConent seismicComment:seismicCommentList) {
					if(seismicComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						seismicCommentListNew.add(seismicComment);
					}
				}
				cdft.setSeismicCommentList(seismicCommentListNew);
				for(OpinionConent seismicComment:seismicCommentedList) {
					if(seismicComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						seismicCommentedListNew.add(seismicComment);
					}
				}
				cdft.setSeismicCommentedList(seismicCommentedListNew);
				//封装节能及太阳能专项审查意见
				for(OpinionConent specialComment:specialCommentList) {
					if(specialComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						specialCommentListNew.add(specialComment);
					}
				}
				cdft.setSpecialCommentList(specialCommentListNew);
				for(OpinionConent specialComment:specialCommentedList) {
					if(specialComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						specialCommentedListNew.add(specialComment);
					}
				}
				cdft.setSpecialCommentedList(specialCommentedListNew);
				//封装绿色建筑审查意见
				for(OpinionConent greenComment:greenCommentList) {
					if(greenComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						greenCommentListNew.add(greenComment);
					}
				}
				cdft.setGreenCommentList(greenCommentListNew);
				for(OpinionConent greenComment:greenCommentedList) {
					if(greenComment.getUnitEngineeringInfoGuid().equals(cdft.getGuid())) {
						greenCommentedListNew.add(greenComment);
					}
				}
				cdft.setGreenCommentedList(greenCommentedListNew);
			}
			cdmNew.setCdftList(cdftNewList);
			if(StringUtils.allFieldIsNotNull(cdmNew)) {
				cdmList.add(cdmNew);
			}
		}
		return cdmList;
	}

	/**
	 * @Title: getChildTokens
	 * @Description: 解析WD_WorkDrawing表中ChildTokens字段
	 * @Author wtj
	 * @DateTime 2020-11-4 16:32:15
	 * @param strXml
	 * @param nodePath
	 * @param ct
	 * @return
	 */
	public static List<ChildTokens> getChildTokens(String strXml, String nodePath, ChildTokens ct){
		Document docResult=XmlUtil.readXML(strXml);
		NodeList nodeList = XmlUtil.getNodeListByXPath(nodePath, docResult);
		List<ChildTokens> ctList = new ArrayList<ChildTokens>();
		for (int i = 1; i < nodeList.getLength()+1; i++) {
			ChildTokens ctNew = new ChildTokens();
			Object guid =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ct.getGuid(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(guid))) {
				ctNew.setGuid(String.valueOf(guid));
			}
			Object name =XmlUtil.getByXPath(nodePath +"["+i+"]/" + ct.getName(), docResult, XPathConstants.STRING);
			if(!StringUtils.isEmpty(String.valueOf(name))) {
				ctNew.setName(String.valueOf(name));
			}
			if(StringUtils.allFieldIsNotNull(ctNew)) {
				ctList.add(ctNew);
			}
		}
		return ctList;
	}
}

